<?php

// Swoole\Timer::tick(3000, function (int $timer_id, $param1, $param2) {
//     echo "timer_id #$timer_id, after 3000ms.\n";
//     echo "param1 is $param1, param2 is $param2.\n";

//     // Swoole\Timer::tick(14000, function ($timer_id) {
//     //     echo "timer_id #$timer_id, after 14000ms.\n";
//     // });
// }, "A", "B");

function curlGet($url)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; ...) Gecko/20100101 Firefox/60.0');

    if(!empty($header)) {
        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    }

    $output = curl_exec($ch);
    $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    return $output;
}

$urlCheck = 'http://api.beeplay.com.cn:8080/outdata/distinct?adid=1401&idfa=6B9F0165-C56D-449D-8580-7B9BF9C1F3F2&udid=9d50f5c17bf44ed9b9ef9ae6077c07f032d01ce0&ip=106.95.76.97&keyword=%E5%AE%B6%E8%A3%85%E8%AE%BE%E8%AE%A1&device_type=iPhone9,1&os_version=12.1.1&source=wozhuanqian&timestamp=1609745894&sign=1b978f6a5858fc862bdc219b55a52d83';

$urlActive = 'http://api.beeplay.com.cn:8080/outdata/active?adid=1401&idfa=6B9F0165-C56D-449D-8580-7B9BF9C1F3F2&udid=9d50f5c17bf44ed9b9ef9ae6077c07f032d01ce0&ip=106.95.76.97&keyword=%E5%AE%B6%E8%A3%85%E8%AE%BE%E8%AE%A1&device_type=iPhone9,1&os_version=12.1.1&source=wozhuanqian&timestamp=1609745894&sign=1b978f6a5858fc862bdc219b55a52d83';

var_dump(curlGet($urlCheck));
var_dump(curlGet($urlActive));